package com.ryan.quartz.temp.observer;

/**
 * @author Rayn on 2017/10/17.
 * @email liuwei412552703@163.com.
 */
public class CurrentConditionsDisplay implements DisplayElement, Observer {

    private float temperature;

    private float humidity;

    private Subject weatherDate;


    public CurrentConditionsDisplay(Subject weatherDate) {
        this.weatherDate = weatherDate;
    }

    /**
     * @param temperature
     * @param humidity
     * @param pressure
     */
    @Override
    public void update(float temperature, float humidity, float pressure) {
        this.temperature = temperature;
        this.humidity = humidity;

        display();
    }

    /**
     * 展示
     */
    @Override
    public void display() {
        System.out.println("Current conditions : " + temperature + " F  degree and " + humidity + "% humidity.");
    }


}
